# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Monitoring.V3.Model.Documentation do
  @moduledoc """
  Documentation that is included in the notifications and incidents pertaining to this policy.

  ## Attributes

  *   `content` (*type:* `String.t`, *default:* `nil`) - The body of the documentation, interpreted according to mime_type. The content may not exceed 8,192 Unicode characters and may not exceed more than 10,240 bytes when encoded in UTF-8 format, whichever is smaller. This text can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars).
  *   `links` (*type:* `list(GoogleApi.Monitoring.V3.Model.Link.t)`, *default:* `nil`) - Optional. Links to content such as playbooks, repositories, and other resources. This field can contain up to 3 entries.
  *   `mimeType` (*type:* `String.t`, *default:* `nil`) - The format of the content field. Presently, only the value "text/markdown" is supported. See Markdown (https://en.wikipedia.org/wiki/Markdown) for more information.
  *   `subject` (*type:* `String.t`, *default:* `nil`) - Optional. The subject line of the notification. The subject line may not exceed 10,240 bytes. In notifications generated by this policy, the contents of the subject line after variable expansion will be truncated to 255 bytes or shorter at the latest UTF-8 character boundary. The 255-byte limit is recommended by this thread (https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). It is both the limit imposed by some third-party ticketing products and it is common to define textual fields in databases as VARCHAR(255).The contents of the subject line can be templatized by using variables (https://cloud.google.com/monitoring/alerts/doc-variables#doc-vars). If this field is missing or empty, a default subject line will be generated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :content => String.t() | nil,
          :links => list(GoogleApi.Monitoring.V3.Model.Link.t()) | nil,
          :mimeType => String.t() | nil,
          :subject => String.t() | nil
        }

  field(:content)
  field(:links, as: GoogleApi.Monitoring.V3.Model.Link, type: :list)
  field(:mimeType)
  field(:subject)
end

defimpl Poison.Decoder, for: GoogleApi.Monitoring.V3.Model.Documentation do
  def decode(value, options) do
    GoogleApi.Monitoring.V3.Model.Documentation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Monitoring.V3.Model.Documentation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
